package com.glsc.ngateway.common.api.amdoc.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.glsc.ngateway.common.api.common.utils.DateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @Author: zzp
 * @Date: 2023/08/03
 * @Desc: OA产品流程Dto，支持返回多个产品调整zzp 20230215
 */
@Builder
@Data
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class OaProductWorkflowDto {

    @ApiModelProperty(value = "请求ID")
    private String requestId;

    @ApiModelProperty(value = "流程ID")
    private String workflowId;

    private Integer lastNodeId;

    private String lastNodeType;

    private Integer currentNodeId;

    private String currentNodeType;

    @ApiModelProperty(value = "流程实例状态（网关返回）")
    private String requestStatus;

    private Integer passedGroups;

    private Integer totalGroups;

    //请注意，requestName是流程实例名称，workflowName是流程类型名称
    @ApiModelProperty(value = "流程实例名称（网关返回）")
    private String requestName;

    @ApiModelProperty(value = "发起人")
    private String creater;

    @ApiModelProperty(value = "发起人姓名")
    private String createrName;

    //非网关返回接口字段
    @ApiModelProperty(value = "发起天数")
    private Long createDays;

    @ApiModelProperty(value = "发起日 格式:YYYY-MM-DD")
    private String createDate;

    @ApiModelProperty(value = "创建时间（网关返回），格式：hh:mm:ss")
    private String createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    @ApiModelProperty(value = "创建时间")
    private Date createDateTime;

    private Integer deleted;

    private Integer requestLevel;

    @ApiModelProperty(value = "申请单号")
    private String requestMark;


    private Integer mainRequestId;

    @ApiModelProperty(value = "创建者OA部门ID")
    private Integer createrDepartmentId;

    @ApiModelProperty(value = "创建者OA部门名称")
    private String createrDepartmentName;

    @ApiModelProperty(value = "流程类型名称：如：6.产品委评审流程（非产品筹设事项）")
    private String workflowName;

    @ApiModelProperty(value = "流程类型")
    private String workflowType;


    @ApiModelProperty(value = "发起人")
    private String opOperator;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    @ApiModelProperty(value = "发起时间")
    private Date opTime;


    //【重要！！！】
    @ApiModelProperty(value = "合成流程全标题，即流程名称-创建人-日期")
    private String oaFlowFullTitle;


//    @Deprecated //因为需要支持多个产品，作废此字段,20230215
//    @ApiModelProperty(value = "产品名称（网关返回）")
//    private String cpmc;

//    @Deprecated //因为需要支持多个产品，作废此字段,20230215
//    @ApiModelProperty(value = "OA档案产品ID（网关返回）")
//    private Integer cpxxId;

    //OA产品信息ID转产品系统产品ID需要做转换
    @ApiModelProperty(value = "OA档案产品信息ID多个，则以英文逗号分割的字符串为准")
    private String productIdListString;

    @ApiModelProperty(value = "OA流程关联的OA产品列表")
    private List<Integer> productIdList;

    //非网关返回字段，产品系统根据 productIdListString转换
    @ApiModelProperty(value = "OA流程关联的OA产品名称")
    private List<String> prodNameList;

    //非网关返回字段，产品系统根据 productIdListString转换
    @ApiModelProperty(value = "OA流程关联的资管产品唯一编码")
    private List<String> prodUniqueIdList;


    //    @Deprecated //因为需要支持多个产品，作废此字段,20230215
//    @ApiModelProperty(value = "OA档案系统产品编码")
//    protected Integer productSysId;

    //多个产品，则逗号分割
    @ApiModelProperty(value = "资管产品名称")
    protected String prodName;


    //OA列表查询后，补充查询字段
    @ApiModelProperty(value = "流程当前节点处理人（多个逗号分割）")
    private String nextNodeProcessor;

    //OA列表查询后，补充查询字段
    @ApiModelProperty(value = "流程当前节点处理人（多个逗号分割）")
    private String nextNodeProcessorAccount;

}
